﻿using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

        BZZ.DataAcess woker = new BZZ.DataAcess();
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        string sql = "select top 1 * from news where isHead='1' order by id desc";
        DataSet dset = woker.Execute(sql);
        int rowCount = 0;
        DataRow row=null;
        int headNewsID=0;

        #region 头条新闻处理
        string headPic = "uploadfiles/nopic.gif";
        if (dset != null) rowCount = dset.Tables[0].Rows.Count;
        if (rowCount > 0)
        {
            row = dset.Tables[0].Rows[0];
            headPic = row["headPic"].ToString();
        }
        else
        {
            sql = "select top 1 * from news order by id desc";
            dset = woker.Execute(sql);
            if (dset != null) rowCount = dset.Tables[0].Rows.Count;
            if (rowCount > 0) row = dset.Tables[0].Rows[0];

        }
        if (rowCount > 0)
        {
            string headTitle = row["title"].ToString();
            string headContent = row["content"].ToString();
            string headID = row["id"].ToString();
            headNewsID=Convert.ToInt32(headID);
            if (headTitle.Length > 12) headTitle = headTitle.Substring(0, 10) + "...";
            headContent = LIB.Filter.StripHTML(headContent);
            headContent = headContent.Replace(" ", "").Replace("　", "");
            if (headContent.Length > 27) headContent = headContent.Substring(0, 26) + "...";
            sb.Append("              <table width=\"250\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("                  <tr>");
            sb.Append("                    <td width=\"65\" rowspan=\"2\" align=\"center\"><a href=\"NewsDetail.aspx?id=" + headID + "&cataid=2\"><img src=\"" + headPic + "\" width=\"65\" height=\"45\" border=\"0\"></a></td>");
            sb.Append("                    <td width=\"10\" height=\"13\">&nbsp;</td>");
            sb.Append("                    <td width=\"175\"><strong class=\"zt\"><a href=\"NewsDetail.aspx?id=" + headID + "&cataid=2\">" + headTitle + "</a></strong></td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td>&nbsp;</td>");
            //sb.Append("                    <td class=\"zt01\">" + headContent + ".</td>");
            sb.Append("                    <td class=\"zt01\">" + headContent + ".</td>");
            sb.Append("                  </tr>");
            sb.Append("              </table>");
            //sb.Append("<br />");
        }
        litHeadNews.Text = sb.ToString(); 
        #endregion

        #region 幻灯片
        sb.Remove(0, sb.Length);
        sql = "select top 5 * from slide order by sortid";
        dset = woker.Execute(sql);
        if (dset != null)
        {
            rowCount = dset.Tables[0].Rows.Count;
            string picUrls = "";
            string gotoUrls = "";
            for (int i = 0; i < rowCount; i++)
            {
                row = dset.Tables[0].Rows[i];
                string picUrl = "img/" + row["picurl"].ToString().Trim();
                string gotoUrl = row["gotoUrl"].ToString().Trim();
                if (gotoUrl == "") gotoUrl = picUrl.Replace("thumb/", "");
                picUrls += picUrl;
                gotoUrl = Server.UrlEncode(gotoUrl);
                gotoUrls += gotoUrl;
                if (i < rowCount - 1)
                {
                    picUrls += "|";
                    gotoUrls += "|";
                }
            }
            sb.Append("<script type=\"text/javascript\">");
            sb.Append("var pics='");
            sb.Append(picUrls);
            sb.Append("';var links='");
            sb.Append(gotoUrls);
            sb.Append("';var texts='|||| ';");
            sb.Append("showBanner();</script> ");
            litSlide.Text = sb.ToString();
        } 
        #endregion

        #region 艺术资讯
        sb.Remove(0, sb.Length);
        sql = "select top 10 * from news where cataid=2 and id<>" + headNewsID.ToString() + " order by id desc";
        dset = woker.Execute(sql);
        for (int i = 0; i < dset.Tables[0].Rows.Count; i++)
        {
            row = dset.Tables[0].Rows[i];
            string title = row["title"].ToString();
            string id = row["id"].ToString();
            string date = Convert.ToDateTime(row["pubDate"]).ToString("MM-dd");
            if (title.Length > 21) title = title.Substring(0, 20) + "...";
            sb.Append("            <tr>");
            sb.Append("              <td class=\"zt01\" align=\"left\">·<a href=\"newsDetail.aspx?id=" + id + "&cataid=2\">" + title + "</a> </td>");
            sb.Append("            </tr>");
        }
        litNews1.Text = sb.ToString(); 
        #endregion

        #region 收藏知识
        sb.Remove(0, sb.Length);
        sql = "select top 13 * from news where cataid=3 and id<>" + headNewsID.ToString() + " order by id desc";
        dset = woker.Execute(sql);
        for (int i = 0; i < dset.Tables[0].Rows.Count; i++)
        {
            row = dset.Tables[0].Rows[i];
            string title = row["title"].ToString();
            string id = row["id"].ToString();
            string date = Convert.ToDateTime(row["pubDate"]).ToString("MM-dd");

            if (title.Length > 21) title = title.Substring(0, 20) + "...";
            sb.Append("            <tr>");
            sb.Append("              <td class=\"zt01\" align=\"left\">·<a href=\"newsDetail.aspx?id=" + id + "&cataid=2\">" + title + "</a> </td>");
            sb.Append("            </tr>");
        }
        litNews2.Text = sb.ToString();
        #endregion

        #region 推荐作品
        sb.Remove(0, sb.Length);
        sql = "select top 20 picUrl,id from product order by id desc";
        dset = woker.Execute(sql);
        sb.Append("		<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>");
        sb.Append("		<tr valign='top'>");
        for (int i = 0; i < dset.Tables[0].Rows.Count; i++)
        {
            row = dset.Tables[0].Rows[i];
            string id = row["id"].ToString();
            string picUrl = row["picurl"].ToString();
            picUrl = "img/" + picUrl;

            sb.Append("			<td align='center' valign=\"middle\" bordercolor=\"#f7f5f2\">");
            sb.Append("			<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
            sb.Append("              <tr>");
            //sb.Append("                <td><a href=\"ProductDetail.aspx?id=" + id + " \"><img src=\"" + picUrl + "\" height=\"120\" border=\"0\"style=\"border:2px solid #f7f5f2\"></a></td>");
            #region 点击查看效果图
            //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
            sb.Append("                        <td>");

            sb.Append("<div class=\"thumbnail\">");
            sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
            sb.Append("    </a>");
            sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
            sb.Append("        <img id='pic1' src=\"" + picUrl + "\" height=\"120\" border=\"0\"style=\"border:2px solid #f7f5f2\"  onload=\"javascript:DrawImage2(this);\"");
            sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
            sb.Append("    </a>");
            sb.Append("</div>");
            //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
            sb.Append(" </td>");
            #endregion


            sb.Append("                <td width=\"30\"></td>");
            sb.Append("              </tr>");
            sb.Append("            </table></td>");



        }
        sb.Append("			</tr>");
        sb.Append("		</table>");
        litRecommondProcudt.Text = sb.ToString(); 
        #endregion

        sb.Remove(0, sb.Length);
        string cata = "国画";

        litProductList1.Text = getProductList(cata);
        litProductList2.Text = getProductList("书法");
        litProductList3.Text = getProductList("篆刻");

        litProfessor1.Text = getProfessorList(cata);
        litProfessor2.Text = getProfessorList("书法");
        litProfessor3.Text = getProfessorList("篆刻");

        #region 友情连接
        sb.Remove(0, sb.Length);
        sql = "select top 6 * from links order by sortid";
        dset = woker.Execute(sql);
        sb.Append("<table width=\"930\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
        sb.Append("      <tr>");
        rowCount = dset.Tables[0].Rows.Count;
        for (int i = 0; i < rowCount; i++)
        {
            row = dset.Tables[0].Rows[i];
            string picUrl = "img/" + row["picurl"].ToString().Trim();
            string gotoUrl = row["gotourl"].ToString().Trim();
            sb.Append("        <td align=\"center\" valign=\"top\" class=\"zt04\" width=\"12%\"><a href='" + gotoUrl + "' target=_blank><img src=\"" + picUrl + " \" width=\"131\" height=\"47\" border=0></a></td>");
        }
        for (int i = rowCount; i < 6; i++)
        {
            sb.Append("<td valign=\"top\" class=\"zt04\" width=\"12%\">&nbsp;</td>");
        }
        sb.Append("        </tr>");
        sb.Append("    </table>");
        litLinks.Text = sb.ToString(); 
        #endregion

        sql = "select * from news where id=188";
        dset = woker.Execute(sql);
        if (dset != null)
        {
            row = dset.Tables[0].Rows[0];
            string content = row["content"].ToString();
            litBottomContent.Text = content;

        }

    }

    private string getProductList2(string cata)
    {
        BZZ.DataAcess woker = new BZZ.DataAcess();
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        string sql2 = "select product.picurl,product.id,product.productcode,product.professorID,professor.realname from product,professor where professor.id=product.professorID and professor.cata='"+cata+"' order by product.id desc";
        DataSet dset2 = woker.Execute(sql2);
        if (dset2 != null)
        {
            int rowCount2 = dset2.Tables[0].Rows.Count;
            DataRow dr = null;
            string picUrl = "";
            string pid = "0";
            string realName = "";
            string pcode = "";
            string professID = "0";
            int k = 0;
            sb.Append("<table width=\"710\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("                  <tr>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");

            #region 一排五个产品

            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion

            #endregion

            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            #region 一排五个产品

            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\" height=120><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td height=120>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString();
                professID = dr["professorID"].ToString();

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" width=\"100\" height=\"76\" border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion

            #endregion

            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                  </tr>");
            sb.Append("                </table>");
        }
        return sb.ToString();
    }

    private string getProductList(string cata)
    {
        BZZ.DataAcess woker = new BZZ.DataAcess();
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        string sql2 = "select product.scaleMode,product.picurl,product.id,product.productcode,product.professorID,professor.realname from product,professor where professor.id=product.professorID and professor.cata='" + cata + "' order by product.id desc";
        DataSet dset2 = woker.Execute(sql2);
        if (dset2 != null)
        {
            int rowCount2 = dset2.Tables[0].Rows.Count;
            DataRow dr = null;
            string picUrl = "";
            string pid = "0";
            string realName = "";
            string pcode = "";
            string professID = "0";
            string scaleMode = "0";
            string strScale = "width=\"100\" height=\"76\"";

            int k = 0;
            sb.Append("<table width=\"710\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("                  <tr>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td width=\"142\" align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");

            #region 一排五个产品

            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" "+strScale+" border=\"0\"></a></td>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>"); 
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion

            #endregion

            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            #region 一排五个产品

            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\" height=120><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td height=120>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion
            #region 一个作品
            if (k < rowCount2)
            {
                dr = dset2.Tables[0].Rows[k];
                picUrl = "img/" + dr["picurl"].ToString();
                pid = dr["id"].ToString();
                realName = dr["realname"].ToString();
                pcode = dr["productcode"].ToString(); professID = dr["professorID"].ToString();
                scaleMode = dr["scalemode"].ToString();
                if (scaleMode == "1") strScale = "width=\"100\"";
                else if (scaleMode == "2") strScale = "height=\"76\"";
                else strScale = "width=\"100\" height=\"76\"";

                sb.Append("                    <td align=\"center\" valign=\"top\"><table width=\"112\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cfcfb8\">");
                sb.Append("                      <tr>");
                #region 点击查看效果图
                //sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\"><a href=\"ProductDetail.aspx?id=" + pid + "\"><img src=\"" + picUrl + "\" " + strScale + " border=\"0\"></a></td>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\">");

                sb.Append("<div class=\"thumbnail\">");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\">");
                sb.Append("    </a>");
                sb.Append("    <a rel=\"lightbox\" href=\"" + picUrl + "\" title=\"\">");
                sb.Append("        <img id='pic1' src=\"" + picUrl + "\" " + strScale + "  onload=\"javascript:DrawImage2(this);\"");
                sb.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
                sb.Append("    </a>");
                sb.Append("</div>");
                //sb.Append("<img src=\"" + picUrl + "\" " + strScale + " border=\"0\">");
                sb.Append(" </td>");
                #endregion

                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\" bgcolor=\"#E7E3DA\" class=\"zt01\"><A title=\"画家李孝萱\" href=\"/ProductDetail.aspx?id=" + pid + "\" target=\"_blank\">" + realName + "</A> | " + pcode + "</td>");
                sb.Append("                      </tr>");
                sb.Append("                    </table></td>");
            }
            else
            {
                sb.Append("<td>&nbsp;</td>");
            }
            k++;
            #endregion

            #endregion

            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                    <td align=\"center\" valign=\"top\">&nbsp;</td>");
            sb.Append("                  </tr>");
            sb.Append("                </table>");
        }
        return sb.ToString();
    }
    
    private string getProfessorList(string cata)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        BZZ.DataAcess woker = new BZZ.DataAcess();
        string sql = "select top 8 * from professor where isAgent='1' and cata='"+cata+"' order by isRecommend desc,id desc";
        DataSet dset = woker.Execute(sql);
        sb.Append("<table width=\"150\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\" class=\"zt01\">");
        sb.Append("                      ");
        sb.Append("                      <tr>");
        sb.Append("                        <td height=\"10\" align=\"center\" valign=\"top\">						</td>");
        sb.Append("                      </tr>");
        if (dset != null)
        {
            int rowCount = dset.Tables[0].Rows.Count;
            int k = 0;
            DataRow dr = null;
            string picUrl = "";
            string realName = "";
            string id = "";
            

            #region 一个作者
            if (k < rowCount)
            {
                dr = dset.Tables[0].Rows[k];
                picUrl ="img/"+ dr["picUrl"].ToString();
                realName = dr["realname"].ToString();
                id = dr["id"].ToString();
                sb.Append("");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\"><a href=\"professorDetail.aspx?id=" + id + "\"><img src=\"" + picUrl + "\" width=\"80\"  height=90 border=\"0\"></a></td>");
                sb.Append("                      </tr>");
                sb.Append("                      <tr>");
                sb.Append("                        <td align=\"center\" valign=\"top\"><a href=\"professorDetail.aspx?id=" + id + "\">" + realName + "</a></td>");
                sb.Append("                      </tr>");
            }
            k++; 
            #endregion
            #region 一个作者
            System.Text.StringBuilder sb2 = new System.Text.StringBuilder();
            if (k < rowCount)
            {
                dr = dset.Tables[0].Rows[k];
                picUrl = "img/" + dr["picUrl"].ToString();
                realName = dr["realname"].ToString();
                id = dr["id"].ToString();
                sb.Append("");
                sb2.Append("                      <tr>");
                sb2.Append("                        <td align=\"center\" valign=\"top\"><a href=\"professorDetail.aspx?id=" + id + "\"><img src=\"" + picUrl + "\" width=\"80\" height=90 border=\"0\"></a></td>");
                sb2.Append("                      </tr>");
                sb2.Append("                      <tr>");
                sb2.Append("                        <td align=\"center\" valign=\"top\"><a href=\"professorDetail.aspx?id=" + id + "\">" + realName + "</a></td>");
                sb2.Append("                      </tr>");
            }
            k++;
            #endregion

            #region 3个作者
            sb.Append("                      <tr>");
            sb.Append("                        <td align=\"center\" valign=\"top\">");
            for(int t=0;k<rowCount;k++)
            {
                t++;
                if (t > 3) break;
                dr = dset.Tables[0].Rows[k];
                picUrl = dr["picUrl"].ToString();
                realName = dr["realname"].ToString();
                id = dr["id"].ToString();
                sb.Append("<a href=\"professorDetail.aspx?id=" + id + "\">" + realName + "</a> ");
            }
            sb.Append("                        </td>");
            sb.Append("                      </tr>");
            sb.Append("                      ");

            sb.Append("                      <tr>");
            sb.Append("                        <td height=\"11\" align=\"center\" valign=\"top\" background=\"img/dot_line.gif\">						</td>");
            sb.Append("                      </tr>");
            k++;
            #endregion
            sb.Append(sb2.ToString());
            #region 3个作者
            sb.Append("                      <tr>");
            sb.Append("                        <td align=\"center\" valign=\"top\">");
            for(;k<rowCount;k++)
            {
                dr = dset.Tables[0].Rows[k];
                picUrl = dr["picUrl"].ToString();
                realName = dr["realname"].ToString();
                id = dr["id"].ToString();
                sb.Append("<a href=\"professorDetail.aspx?id=" + id + "\">" + realName + "</a> ");
            }
            sb.Append("                        </td>");
            sb.Append("                      </tr>");
            sb.Append("                      ");

            sb.Append("                      <tr>");
            sb.Append("                        <td height=\"11\" align=\"center\" valign=\"top\" background=\"img/dot_line.gif\">						</td>");
            sb.Append("                      </tr>");
            //k++;
            #endregion


        }
        string cataID = "1";
        if (cata == "书法") cataID = "2";
        else if (cata == "篆刻") cataID = "3";
        sb.Append("                      <tr>");
        sb.Append("                        <td align=\"right\" valign=\"top\"><a href=\"FamousList.aspx?cata="+cataID+"\">&gt;&gt; 更多</a></td>");
        sb.Append("                      </tr>");
        sb.Append("                    </table>");
        return sb.ToString();



    }
    protected void btnQuery_Click(object sender, ImageClickEventArgs e)
    {

        string cata = ddlProductCata.SelectedValue;
        string keword = txtKeyWord.Text.Trim();
        keword = LIB.Filter.inputFilter(keword);
        string gotoUrl = "query.aspx?t=" + cata + "&k=" + Server.UrlEncode(keword);
        Response.Redirect(gotoUrl);
        //Server.Transfer("query.aspx");
        return;

        
    }
}
